<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="t" uri="http://xiaowo.me/tags"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="/WEB-INF/lib/jsp/main_head.jsp" />
<title>${entity.entityComment}</title>
<style type="text/css">
	
</style>
</head>
<body>
	<div class="form-header">${entity.entityComment}信息</div>
	<div class="ui divider"></div>
	
	<#assign first=true>
	<div class="form-container">
		<form class="ui xw form" action="${r"${"}actionKey }/${r"${"}action}" method="post">
<#list entity.fields as field>
	<#if (field.fieldName != "status")>
		<#if (first)>
			<#assign first=false>
			<div class="inline field">
				<label>${field.comment}</label>
				<input type="hidden" name="id" value="${r"${"}${entityNameLower}.id }" />
				<input type="text" name="${field.fieldName}" value="${r"${"}${entityNameLower}.${field.fieldName} }" />
			</div>
		<#else>
			<div class="inline field">
				<label>${field.comment}</label>
				<input type="text" name="${field.fieldName}" value="${r"${"}${entityNameLower}.${field.fieldName} }" />
			</div>
		</#if>
	</#if>
</#list>
			<div class="inline field">
				<label>状态</label>
				<select name="status" class="ui dropdown">
					<option value="1">启用</option>
					<option value="0">停用</option>
					<option value="-1">删除</option>
				</select>
			</div>
			
			<div class="ui divider"></div>
			<button type="submit" class="ui primary button">保存</button>
		</form>
	</div>
	
	<script type="text/javascript">
		$(function(){
			var status = "${r"${"}${entityNameLower}.status }";
			if(status != "")
				$("select[name='status']").dropdown('set selected', status);
		});
	</script>
</body>
</html>